struct blkif_response *rsp;
moretodo:
+#ifdef HAVE_LIBC
+ files[dev->fd].read = 0;
+ mb(); /* Make sure to let the handler set read to 1 before we start looking at the ring */
+#endif
+
rp = dev->ring.sring->rsp_prod;
rmb(); /* Ensure we see queued responses up to 'rp'. */
cons = dev->ring.rsp_cons;
return 100;
}
+static void vbd_io_completed(void *opaque)
+{
+ BDRVVbdState *s = opaque;
+ blkfront_aio_poll(s->dev);
+}
+
static int vbd_open(BlockDriverState *bs, const char *filename, int flags)
{
BDRVVbdState *s = bs->opaque;
}
s->fd = blkfront_open(s->dev);
+ qemu_set_fd_handler(s->fd, vbd_io_completed, NULL, s);
QEMU_LIST_INSERT_HEAD(&vbds, s, list);
void qemu_aio_poll(void)
{
- BDRVVbdState *s;
- for (s = vbds.lh_first; s; s = s->list.le_next)
- blkfront_aio_poll(s->dev);
}
/* Wait for all IO requests to complete. */